﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PhatPhucLoc.model;
using PhatPhucLoc.dao;

namespace PhatPhucLoc.view
{
    public partial class FormThemKhanhHangSanPham : Form
    {
        private FormKhachHangSanPham formKhachHangSanPham= null;
        private KhachHangModel khachHangModel;
        public FormThemKhanhHangSanPham()
        {
            InitializeComponent();
        }

        public FormThemKhanhHangSanPham(KhachHangModel _khachHangModel, FormKhachHangSanPham _formKhachHangSanPham)
        {
            InitializeComponent();
            khachHangModel = _khachHangModel;
            formKhachHangSanPham = _formKhachHangSanPham;
            txtKhachHang.Text = _khachHangModel.Ten;
            FormThemKhanhHangSanPhamLoad();
        }

        public void FormThemKhanhHangSanPhamLoad()
        {
            cbbHangHoa.DataSource = HangHoaDAO.GetAll();
            cbbHangHoa.DisplayMember = "TenHangHoa";
            cbbHangHoa.ValueMember = "id";
        }

        private void btnChapNhan_Click(object sender, EventArgs e)
        {
            txtKhachHang.Text = "0";
            txtGiaTien.Text = "15000";
            cbbHangHoa.SelectedValue.ToString();
        }
    }
}
